<template>
    <div>
        <van-nav-bar title="商品详情" left-text="返回" left-arrow @click-left="() => { $router.back() }" fixed />
<div style="height: 45px;"></div>
<div v-html="detailApiData.goods_introduce"></div>
<van-action-bar>
  <van-action-bar-icon icon="chat-o" text="客服" color="#ee0a24" />
  <van-action-bar-icon icon="cart-o" text="购物车" />
  <van-action-bar-icon icon="star" text="已收藏" color="#ff5000" />
  <van-action-bar-button type="warning" text="加入购物车"  @click="AddCart"/>
  <van-action-bar-button type="danger" text="立即购买" />
</van-action-bar>

    </div>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
let router = useRouter()
// console.log(57443);
// let c = ref(57443);
let detailApiData = ref([])
import { detailApi } from '@/api/api';
detailApi(57443).then(res => {
    console.log(res);
   detailApiData.value = res.data.message
})
import { useCounterStore } from '@/stores/piniaCart'
// 在组件内部的任何地方均可以访问变量 `store` ✨
const store = useCounterStore()
const AddCart=()=>{
    store.piniaAddCart=(detailApiData.value,57443)
    router.push('/home/cart')
}

</script>

<style lang="scss" scoped></style>